package com.funong.matrix.core.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.sql.Timestamp;

@Data
@Accessors(chain = true)
public class FunongBaseEntity implements Serializable {

    private static final long serialVersionUID = -6971443619502487987L;

    @TableField("id")
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value="自增ID")
    private Integer id;

    @TableField("is_deleted")//0未被删除1已被删除
    @ApiModelProperty(value="0未被删除1已被删除")
    private Integer isDeleted;

    @TableField("memo")
    @ApiModelProperty(value="备注")
    String memo;

    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value="创建时间")
    private Timestamp createdAt;

    @TableField("created_by")
    @ApiModelProperty(value="创建人")
    String createdBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value="更新时间")
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private Timestamp updatedAt;

    @TableField("updated_by")
    @ApiModelProperty(value="更新人")
    String updatedBy;
}
